import java.util.HashSet;
import java.util.Set;

public class Test {
    public static boolean containsDuplicate(int[] nums) {
        Set<Integer> set=new HashSet<>();
        for(int x:nums){
            if(!set.contains(x)){
                set.add(x);
            }else{
                return false;
            }
        }
        return true;

    }
    public static void main(String[] args) {
        int[] array={1,2,3,1};
        boolean flg=containsDuplicate(array);
        System.out.println(flg);
    }
}
